//===============================================================================
// Microsoft patterns & practices
// Composite Application Guidance for Windows Presentation Foundation
//===============================================================================
// Copyright (c) Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================

using Microsoft.Practices.Prism.Events;
using Microsoft.Practices.Prism.Regions;
using P2.Cuberry.Framework.BOLBase;
using P2.Cuberry.Framework.Helper;
namespace P2.Cuberry.Modules.Framework.ApplicationConfigurator
{
    using System;
    using System.Windows;
    using Microsoft.Practices.Unity;

    public class ModulesPresenter
    {
        private IUnityContainer container;
        private IRegionManager regionManager;
        private IApplicationConfiguratorPresenter listPresenter;      

        public ModulesPresenter(
            IApplicationConfiguratorView view,
            IApplicationConfiguratorPresenter listPresenter,        
            IUnityContainer container, 
            IRegionManager regionManager)
        {
            this.container = container;
            this.regionManager = regionManager;
            this.View = view;
            this.listPresenter = listPresenter;
            //this.listPresenter.ModuleSelected += new EventHandler<DataEventArgs<BusinessEntities.Module>>(this.OnModuleSelected);
            //this.listPresenter.ModuleOpened += new EventHandler<DataEventArgs<BusinessEntities.Module>>(this.OnModuleOpened);
           
            //View.SetHeader(listPresenter.View);
        }

        public IApplicationConfiguratorView View { get; set; }


//        public void OnModuleSelected(object sender, DataEventArgs<BusinessEntities.Module> e)
//        {
  
//        }



//        public void OnModuleOpened(object sender, DataEventArgs<BusinessEntities.Module> e)
//        {
///*           
//            IModulesDetailsView dv = this.container.Resolve<IUsersDetailsView>();
          
//            e.Value.FillMyObject();
//            Services.IUserService service = this.container.Resolve<Services.IUserService>();
//            UsersDetailsPresentationModel pm = new UsersDetailsPresentationModel(dv, e.Value, service,container, regionManager, sender);
           
//            dv.FlowDirection = (P2Translator.Culture.TextInfo.IsRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight);
//            dv.ShowDialog();
//            pm = null;
//            dv = null;
//            GC.Collect();
// */
//        }

//        public void OnModuleFind(object sender, DataEventArgs<BusinessEntities.ModuleQuery> e)
//        {
//            if (listPresenter != null)
//            {
//                listPresenter.FindModule(e.Value);
//            }
//        }

    }
}
